<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Modal</title>
  <link rel="stylesheet" href="../css/common.css">
  <link rel="stylesheet" href="modal.css">
</head>
<body>
  <button type="button" id="btn" data-target="modal">Show modal</button>
  <div id="modal" class="modal fade">
    <div class="modal-dialog">
      <div class="modal-header">
        <button type="button" class="close">
          <span>x</span>
        </button>
        <h4 class="modal-title">Modal title</h4>
      </div>
      <div class="modal-body">Modal body</div>
      <div class="modal-footer">
        <button type="button">Close</button>
        <button type="button">Save</button>
      </div>
    </div>
  </div>
  <script src="modal.js"></script>
  <script>
    const modal = new Modal('#modal');
    const btn = document.getElementById('btn');
    btn.addEventListener('click', () => {
      modal.show();
    });
  </script>
</body>
</html>